﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Share_MenuNgang : System.Web.UI.UserControl
{
    public string mPaker = "";
    public string mWater = "";
    public string mOther = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            CommonDAO c = new CommonDAO();
            DataTable t = c.queryForTable("select * from sanpham_nhom order by dangma", "t");
            DataView p = t.DefaultView;
            p.RowFilter = "dangma like '000.%'";
            foreach (DataRowView r in p)
            {
                mPaker += "<li><a href=\"List.aspx?type=sp&catid=" + r["Id"] + "\">" + r["Name"] + "</a></li>";
            }
            DataView w = t.DefaultView;
            w.RowFilter = "dangma like '001.%'";
            foreach (DataRowView r in w)
            {
                mWater += "<li><a href=\"List.aspx?type=sp&catid=" + r["Id"] + "\">" + r["Name"] + "</a></li>";
            }
            DataView k = t.DefaultView;
            k.RowFilter = "dangma like '002.%'";
            foreach (DataRowView r in k)
            {
                mOther += "<li><a href=\"List.aspx?type=sp&catid=" + r["Id"] + "\">" + r["Name"] + "</a></li>";
            }
            lblParker.Text = mPaker;
            lblWater.Text = mWater;
            lblOther.Text = mOther;
        }

    }
}
